import { FormIcon, ListIcon, LogoutIcon, ShopIcon } from 'tdesign-icons-vue-next';
import { shallowRef } from 'vue';

import Layout from '@/layouts/index.vue';

export default [
  {
    path: '/shop',
    component: Layout,
    redirect: '/shop/goods',
    name: 'shop',
    meta: { title: { zh_CN: '商城页', en_US: 'shopPage' }, icon: shallowRef(ShopIcon), expanded: true },
    children: [
      {
        path: 'goods',
        name: 'goods',
        component: () => import('@/pages/shop/goods/index.vue'),
        meta: { title: { zh_CN: '商品', en_US: 'goods' }, orderNo: 0 },
      },
      {
        path: 'cart',
        name: 'cart',
        component: () => import('@/pages/shop/cart/index.vue'),
        meta: { title: { zh_CN: '购物车', en_US: 'cart' }, orderNo: 1 },
      },
      {
        path: 'detail',
        name: 'detail',
        component: () => import('@/pages/shop/detail/index.vue'),
        meta: { title: { zh_CN: '商品详情', en_US: 'Goods Detail' }, orderNo: 2, hidden: true },
      },
    ],
  },
  {
    path: '/adminModule',
    component: Layout,
    redirect: '/adminModule/goodsManage',
    name: 'adminModule',
    meta: { title: { zh_CN: '管理中心', en_US: 'adminModulePage' }, icon: shallowRef(ListIcon), expanded: true },
    children: [
      {
        path: 'goodsManage',
        name: 'goodsManage',
        component: () => import('@/pages/adminModule/goodsManage/index.vue'),
        meta: { title: { zh_CN: '商品管理', en_US: 'goodsManage' }, orderNo: 0 },
      },
      {
        path: 'ordersManage',
        name: 'ordersManage',
        component: () => import('@/pages/adminModule/ordersManage/index.vue'),
        meta: { title: { zh_CN: '订单管理', en_US: 'ordersManage' }, orderNo: 1 },
      },
      {
        path: 'orderDetails',
        name: 'orderDetails',
        component: () => import('@/pages/adminModule/orderDetails/index.vue'),
        meta: {
          title: {
            zh_CN: '基础详情页',
            en_US: 'Detail Base',
          },
          hidden: true,
        },
      },
      {
        path: 'userManage',
        name: 'userManage',
        component: () => import('@/pages/setting/userManage/index.vue'),
        meta: { title: { zh_CN: '用户管理', en_US: 'userManagement' } },
      },
    ],
  },
  {
    path: '/list',
    component: Layout,
    redirect: '/list/base',
    name: 'list',
    meta: { title: { zh_CN: '列表页', en_US: 'listPage' }, icon: shallowRef(ListIcon), expanded: true, hidden: true },
    children: [
      {
        path: 'base',
        name: 'ListBase',
        component: () => import('@/pages/list/base/index.vue'),
        meta: { title: { zh_CN: '基础列表页', en_US: 'baseList' }, orderNo: 0 },
      },
      {
        path: 'card',
        name: 'ListCard',
        component: () => import('@/pages/list/card/index.vue'),
        meta: { title: { zh_CN: '卡片列表页', en_US: 'cardList' }, hiddenBreadcrumb: true },
      },
      {
        path: 'filter',
        name: 'ListFilter',
        component: () => import('@/pages/list/filter/index.vue'),
        meta: { title: { zh_CN: '筛选列表页', en_US: 'filterList' } },
      },
      {
        path: 'tree',
        name: 'ListTree',
        component: () => import('@/pages/list/tree/index.vue'),
        meta: { title: { zh_CN: '树状筛选列表页', en_US: 'treeList' } },
      },
    ],
  },
  {
    path: '/form',
    name: 'form',
    component: Layout,
    redirect: '/form/base',
    meta: { title: { zh_CN: '表单页', en_US: 'formPage', hidden: true }, icon: shallowRef(FormIcon), hidden: true },
    children: [
      {
        path: 'base',
        name: 'FormBase',
        component: () => import('@/pages/form/base/index.vue'),
        meta: { title: { zh_CN: '基础表单页', en_US: 'baseForm' } },
      },
      {
        path: 'step',
        name: 'FormStep',
        component: () => import('@/pages/form/step/index.vue'),
        meta: { title: { zh_CN: '分步表单页', en_US: 'stepForm' } },
      },
    ],
  },
  {
    path: '/user',
    name: 'user',
    component: Layout,
    redirect: '/user',
    meta: { title: { zh_CN: '个人中心', en_US: 'User Center' }, icon: 'user-circle' },
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/pages/user/mine/index.vue'),
        meta: { title: { zh_CN: '个人中心', en_US: 'User Center' } },
      },
      {
        path: 'order',
        name: 'order',
        component: () => import('@/pages/user/order/index.vue'),
        meta: { title: { zh_CN: '我的订单', en_US: 'My Orders' } },
      },
    ],
  },
  {
    path: '/report',
    name: 'report',
    component: Layout,
    redirect: '/report/business',
    meta: { title: { zh_CN: '数据统计', en_US: 'formPage' }, icon: 'saving-pot', hidden: true },
    children: [
      {
        path: 'business',
        name: 'BusinessReport',
        component: () => import('@/pages/report/business/index.vue'),
        meta: { title: { zh_CN: '营业报表', en_US: 'BusinessReport' } },
      },
    ],
  },
  {
    path: '/detail',
    name: 'Detail',
    component: Layout,
    redirect: '/detail/base',
    meta: {
      title: {
        zh_CN: '订单详情',
        en_US: 'Detail',
      },
      icon: 'folder-details',
      hidden: true,
    },
    children: [
      {
        path: 'base',
        name: 'DetailBase',
        component: () => import('@/pages/detail/base/index.vue'),
        meta: {
          title: {
            zh_CN: '基础详情页',
            en_US: 'Detail Base',
          },
        },
      },
    ],
  },
  {
    path: '/chat',
    component: Layout,
    redirect: '/chat/petAI',
    name: 'chat',
    meta: {
      title: {
        zh_CN: 'PET AI',
        en_US: 'PET AI',
      },
      icon: 'saving-pot',
      single: true,
    },
    children: [
      {
        path: 'petAI',
        name: 'petAI',
        component: () => import('@/pages/ai/index.vue'),
        meta: {
          title: {
            zh_CN: 'PET AI',
            en_US: 'PET AI',
          },
        },
      },
    ],
  },
  {
    path: '/loginRedirect',
    name: 'loginRedirect',
    redirect: '/login',
    meta: { title: { zh_CN: '登录页', en_US: 'Login' }, icon: shallowRef(LogoutIcon), single: true },
    component: () => import('@/layouts/blank.vue'),
    children: [
      {
        path: 'index',
        redirect: '/login',
        component: () => import('@/layouts/blank.vue'),
        meta: { title: { zh_CN: '登录页', en_US: 'Login' } },
      },
    ],
  },
];
